<template>
	<div class="box">
		<el-form ref="form" label-width="80px" class='container'>
		  <h3 class="title">管理员登录</h3>
		  <el-input placeholder="请输入账号" type="text" v-model="account"></el-input>
		  <el-input placeholder="请输入密码" type="password" class="put" v-model="pwd"></el-input>
		  <el-button type="primary" class="btn" @click='login'>登录</el-button>
		</el-form>
	</div>
</template>

<script>
	export default{
		name:'Login',
		data() {
			return{
				account:'admin',
				pwd:'123456'
			}
		},
		methods: {
			login() {
				if(this.account =='' || this.pwd==''){
					this.$message({showClose: true, message: '账号或密码为空', duration: 1000});
				}
				else{
					if(this.account == 'admin' && this.pwd == '123456'){
						this.$message({showClose: true, message: '登录成功', duration: 1000});
						setTimeout(()=>{
							this.$router.push('./index');
						},1000)
					}
					else{
						this.$message({showClose: true, message: '登录失败', duration: 1000});
					}
				}
			}
		},
	}
</script>

<style>

</style>
<style  scoped>
	.box{
	  position: absolute;
	  top: 0;
	  bottom: 0;
	  width: 100%;
	  background:url(../assets/imges/backgroud.png);
	  background-repeat: no-repeat;
	  background-size: 100% 100%;
	}
	.container{
		box-shadow: 0 0px 8px 0 rgba(0, 0, 0, 0.06), 0 1px 0px 0 rgba(0, 0, 0, 0.02);
		-webkit-border-radius: 5px;
		border-radius: 5px;
		-moz-border-radius: 5px;
		background-clip: padding-box;
		margin: 160px auto;
		width: 350px;
		padding: 35px;
		background: #fff;
		border: 1px solid #eaeaea;
		box-shadow: 0 0 25px #cac6c6;
    opacity: .8;
	}
	.title {
	  margin: 0px auto 40px auto;
	  text-align: center;
	  color: #505458;
	}
	.remember {
	  margin: 0px 0px 35px 0px;
	}
	.btn{
		width: 100%;
	}
	.put{
		margin: 20px 0;
	}
</style>
